package com.whfc.mach.dao;

import com.whfc.mach.dto.warn.AppWarnRuleDTO;
import com.whfc.mach.entity.AppMachWarnRule;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppMachWarnRuleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppMachWarnRule record);

    int insertSelective(AppMachWarnRule record);

    AppMachWarnRule selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppMachWarnRule record);

    int updateByPrimaryKey(AppMachWarnRule record);

    /**
     * 查询设备报警规则列表
     *
     * @param deptId
     * @param ruleType
     * @param keyword
     * @param enableFlag
     * @return
     */
    List<AppWarnRuleDTO> selectRuleList(@Param("deptId") Integer deptId,
                                        @Param("ruleType") Integer ruleType,
                                        @Param("keyword") String keyword,
                                        @Param("enableFlag") Integer enableFlag);

    /**
     * 逻辑删除
     *
     * @param ruleId
     */
    void deleteLogicById(@Param("ruleId") Integer ruleId);

    /**
     * 启用/禁用报警规则
     *
     * @param ruleId
     * @param enableFlag
     */
    void updateEnableFlagByRuleId(@Param("ruleId") Integer ruleId, @Param("enableFlag") Integer enableFlag);
}